package me.sdevil507.supports.helper;

import java.util.Random;

/**
 * 随机码生成工具类
 *
 * @author sdevil507
 */
public class RandomCodeHelper {

    /**
     * 执行生成指定位数随机数字序列
     *
     * @param digits 位数
     * @return 随机码
     */
    public static String exec(int digits) {
        Random random = new Random();
        StringBuilder code = new StringBuilder();
        for (int i = 0; i < digits; i++) {
            code.append(random.nextInt(10));
        }
        return code.toString();
    }
}
